extern "C"
{
	#include "visLic.h"
}
using namespace visualization;

int main(int argc, char **argv)
{
	if(argc < 2)
	{
		printf("\nInput the data file please....\n\n");
		return 0;
	}

	int		      		n_xres = SQUARE_FLOW_FIELD_SZ;
	int							n_yres = SQUARE_FLOW_FIELD_SZ;
	double*					pVectr = new double[n_xres * n_yres * 2];
	double*					p_LUT0 = new double[DISCRETE_FILTER_SIZE];
	double*					p_LUT1 = new double[DISCRETE_FILTER_SIZE];
	unsigned char*	pNoise = new unsigned char[n_xres * n_yres];
	unsigned char*	pImage = new unsigned char[n_xres * n_yres];

	InputDataFile(argv[1], n_xres, n_yres, pVectr);
//	SyntheszSaddle(n_xres, n_yres, pVectr);
	NormalizVectrs(n_xres, n_yres, pVectr);
	MakeWhiteNoise(n_xres, n_yres, pNoise);
	GenBoxFiltrLUT(DISCRETE_FILTER_SIZE, p_LUT0, p_LUT1);
	FlowImagingLIC(n_xres, n_yres, pVectr, pNoise, pImage, p_LUT0, p_LUT1, LOWPASS_FILTR_LENGTH);
	WriteImage2PPM(n_xres, n_yres, pImage, (char*)"LIC.ppm");

	delete []pVectr;
	delete []p_LUT0;
	delete []p_LUT1;
	delete []pNoise;
	delete []pImage;

	return 0;
}
